<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>数字键盘计算器</title>
		<style>
			input[type=button] {
				width: 50px;
				height: 50px;
				border-radius: 50%;
				margin: 5px;
				font-size: 20px;
				background: darkorange;
				color: white;
				text-align: center;
			}
			
			input[type=text] {
				width: 300px;
				height: 40px;
				margin: 5px;
				font-size: 30px;
				border: 2px solid goldenrod;
			}
		</style>
	</head>

	<body>

		<input type="text" id="num" />
		<br />
		<input type="button" value="C" onclick="c()"/>
		<input type="button" value="+" onclick="jia()" />
		<input type="button" value="-" onclick="jian()" />
		<input type="button" value="*" onclick="chen()" />
		<input type="button" value="/" onclick="chu()" />
		<br />
		<input type="button" value="1" onclick="one()" />
		<input type="button" value="2" onclick="two()" />
		<input type="button" value="3" onclick="three()" />
		<input type="button" value="4" onclick="four()" />
		<input type="button" value="5" onclick="five()" />
		<br />
		<input type="button" value="6" onclick="six()" />
		<input type="button" value="7" onclick="seven()" />
		<input type="button" value="8" onclick="eight()" />
		<input type="button" value="9" onclick="nine()" />
		<input type="button" value="0" onclick="zero()" />

		<script>
			//功能键
			var c=function(){
				num.value="";
			};
			
          //数字键
			var one = function() {
				num.value = num.value + "1";
			};
			var two = function() {
				num.value = num.value + "2";
			};
			var three = function() {
				num.value = num.value + "3";
			};
			var four = function() {
				num.value = num.value + "4";
			};
			var five = function() {
				num.value = num.value + "5";
			};
			var six = function() {
				num.value = num.value + "6";
			};
			var seven = function() {
				num.value = num.value + "7";
			};
			var eight = function() {
				num.value = num.value + "8";
			};
			var nine = function() {
				num.value = num.value + "9";
			};
			var zero = function() {
				num.value = num.value + "0";
			};
			
		</script>
	</body>

</html>